package com.yang.mall.controller.admin;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yang.mall.dto.LoginDTO;
import com.yang.mall.dto.MemberDTO;
import com.yang.mall.dto.ProductDTO;
import com.yang.mall.entity.Banner;
import com.yang.mall.entity.Member;
import com.yang.mall.entity.OLResponse;
import com.yang.mall.entity.QueryRequest;
import com.yang.mall.service.IMemberService;
import com.yang.mall.vo.MemberVO;
import com.yang.mall.vo.ProductVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;

/**
 * <p>
 * 会员表 前端控制器
 * </p>
 *
 * @author kadorlin
 * @since 2022-10-21
 */
@Api(tags = "【PC】会员模块")
@RestController
@RequestMapping("/admin/member")
public class MemberAdminController {

    @Autowired
    private IMemberService memberService;

    @ApiOperation("会员分页查询")
    @GetMapping("list")
    public OLResponse<IPage<MemberVO>> findPage(MemberDTO memberDTO) {
        return new OLResponse().success(memberService.findPage(memberDTO));
    }

    @ApiOperation("审核会员")
    @PutMapping("/audit")
    public OLResponse audit(@RequestBody MemberDTO memberDTO){
        memberService.audit(memberDTO);
        return new OLResponse().success();
    }

}
